<!doctype html>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
    <meta charset="utf-8">
    <title>suggestion关闭后不再显示</title>
    <!--demo展示所用css，不用关心 begin-->
    <link rel="stylesheet" type="text/css" href="../../../assets/reset.css" />
    <link rel="stylesheet" type="text/css" href="../../../examples/assets/suggestion_demo.css" />
    <!--demo展示所用css end-->

    <!--组件依赖css begin-->
    <link rel="stylesheet" type="text/css" href="../../../assets/widget/suggestion/suggestion.css" />
    <link rel="stylesheet" type="text/css" href="../../../assets/widget/suggestion/suggestion.default.css" />    <!--皮肤文件，若不使用该皮肤，可以不加载-->
    <!--组件依赖css end-->

    <!--组件依赖js begin-->
    <script type="text/javascript" src="../../../dist/zepto.js"></script>

    <!--gmu extend文件-->
    <script type="text/javascript" src="../../../src/extend/touch.js"></script>      <!--新版zepto合并版中不包括touch.js-->
    <script type="text/javascript" src="../../../src/extend/highlight.js"></script>

    <!--gmu base文件-->
    <script type="text/javascript" src="../../../src/core/gmu.js"></script>
    <script type="text/javascript" src="../../../src/core/event.js"></script>
    <script type="text/javascript" src="../../../src/core/widget.js"></script>

    <script type="text/javascript" src="../../../src/widget/suggestion/suggestion.js"></script>
    <script type="text/javascript" src="../../../src/widget/suggestion/sendrequest.js"></script>
    <script type="text/javascript" src="../../../src/widget/suggestion/renderlist.js"></script>
    <!--组件依赖js end-->
</head>
<body>
<form action="http://www.baidu.com/s" method="get">
    <div class="search">
        <div class="search-input"><input type="text" id="input" name="wd"></div>
        <div class="search-button"><input type="submit" value="百度一下"></div>
    </div>
</form>

<script type="text/javascript">
    (function () {
        $('#input').suggestion({
            source: "../../data/suggestion.php"
        }).on('close', function () {

            // 点击关闭按钮后，sug不再显示
            $('#input').suggestion('destroy');
        });
    })();
</script>
</body>
</html>